package com.ruoyi.system.service.city.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.city.CityTagMapper;
import com.ruoyi.system.domain.city.CityTag;
import com.ruoyi.system.service.city.ICityTagService;

/**
 * 标签Service业务层处理
 *
 * @author cjq
 * @date 2023-07-24
 */
@Service
public class CityTagServiceImpl extends ServiceImpl<CityTagMapper, CityTag> implements ICityTagService {
    @Autowired
    private CityTagMapper cityTagMapper;

    /**
     * 查询标签
     *
     * @param tagId 标签主键
     * @return 标签
     */
    @Override
    public CityTag selectCityTagByTagId(Long tagId) {
        return cityTagMapper.selectCityTagByTagId(tagId);
    }

    /**
     * 查询标签列表
     *
     * @param cityTag 标签
     * @return 标签
     */
    @Override
    public List<CityTag> selectCityTagList(CityTag cityTag) {
        return cityTagMapper.selectCityTagList(cityTag);
    }

    /**
     * 新增标签
     *
     * @param cityTag 标签
     * @return 结果
     */
    @Override
    public int insertCityTag(CityTag cityTag) {
        cityTag.setCreateTime(DateUtils.getNowDate());
        return cityTagMapper.insertCityTag(cityTag);
    }

    /**
     * 修改标签
     *
     * @param cityTag 标签
     * @return 结果
     */
    @Override
    public int updateCityTag(CityTag cityTag) {
        return cityTagMapper.updateCityTag(cityTag);
    }

    /**
     * 批量删除标签
     *
     * @param tagIds 需要删除的标签主键
     * @return 结果
     */
    @Override
    public int deleteCityTagByTagIds(Long[] tagIds) {
        return cityTagMapper.deleteCityTagByTagIds(tagIds);
    }

    /**
     * 删除标签信息
     *
     * @param tagId 标签主键
     * @return 结果
     */
    @Override
    public int deleteCityTagByTagId(Long tagId) {
        return cityTagMapper.deleteCityTagByTagId(tagId);
    }
}
